package com.wwwarehouse.taskcenter.bean.job_point;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Jackie on 2017/10/30.
 * 查询概念物请求实体
 */

public class ItemInfoResponseBean implements Parcelable {
    private int total;
    private int page;
    private int size;
    private List<ItemDetailsBean> list;

    public static class ItemDetailsBean implements Parcelable {
        /**
         * abstractObjectUkid : 11
         * name : 名字
         * unitName : 单位
         * unitUkid : 11
         */

        private String abstractObjectUkid;
        private String name;
        private String unitName;
        private String unitUkid;
        private boolean isSelect;
        private int count = 1;

        public String getAbstractObjectUkid() {
            return abstractObjectUkid;
        }

        public void setAbstractObjectUkid(String abstractObjectUkid) {
            this.abstractObjectUkid = abstractObjectUkid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getUnitName() {
            return unitName;
        }

        public void setUnitName(String unitName) {
            this.unitName = unitName;
        }

        public String getUnitUkid() {
            return unitUkid;
        }

        public void setUnitUkid(String unitUkid) {
            this.unitUkid = unitUkid;
        }

        public boolean isSelect() {
            return isSelect;
        }

        public void setSelect(boolean select) {
            isSelect = select;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }


        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.abstractObjectUkid);
            dest.writeString(this.name);
            dest.writeString(this.unitName);
            dest.writeString(this.unitUkid);
            dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
            dest.writeInt(this.count);
        }

        public ItemDetailsBean() {
        }

        protected ItemDetailsBean(Parcel in) {
            this.abstractObjectUkid = in.readString();
            this.name = in.readString();
            this.unitName = in.readString();
            this.unitUkid = in.readString();
            this.isSelect = in.readByte() != 0;
            this.count = in.readInt();
        }

        public static final Creator<ItemDetailsBean> CREATOR = new Creator<ItemDetailsBean>() {
            @Override
            public ItemDetailsBean createFromParcel(Parcel source) {
                return new ItemDetailsBean(source);
            }

            @Override
            public ItemDetailsBean[] newArray(int size) {
                return new ItemDetailsBean[size];
            }
        };
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public List<ItemDetailsBean> getList() {
        return list;
    }

    public void setList(List<ItemDetailsBean> list) {
        this.list = list;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.total);
        dest.writeInt(this.page);
        dest.writeInt(this.size);
        dest.writeList(this.list);
    }

    public ItemInfoResponseBean() {
    }

    protected ItemInfoResponseBean(Parcel in) {
        this.total = in.readInt();
        this.page = in.readInt();
        this.size = in.readInt();
        this.list = new ArrayList<ItemDetailsBean>();
        in.readList(this.list, ItemDetailsBean.class.getClassLoader());
    }

    public static final Creator<ItemInfoResponseBean> CREATOR = new Creator<ItemInfoResponseBean>() {
        @Override
        public ItemInfoResponseBean createFromParcel(Parcel source) {
            return new ItemInfoResponseBean(source);
        }

        @Override
        public ItemInfoResponseBean[] newArray(int size) {
            return new ItemInfoResponseBean[size];
        }
    };
}
